﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Automapping;
using SharpArch.Data.NHibernate.FluentNHibernate;
using TrilhaImovel.Core.Entities;
using SharpArch.Core.DomainModel;

namespace TrilhaImovel.Data.NHibernateMaps
{
    public class AutoPersistenceModelGenerator : IAutoPersistenceModelGenerator
    {

        #region IAutoPersistenceModelGenerator Members

        public AutoPersistenceModel Generate()
        {
            return AutoMap.AssemblyOf<GeocodingLog>(new AutomappingConfiguration())
                .IgnoreBase<Entity>()
                .IgnoreBase(typeof(EntityWithTypedId<>))
                .UseOverridesFromAssemblyOf<AutoPersistenceModelGenerator>();
        }

        #endregion

        //private Action<IConventionFinder> GetConventions()
        //{
        //    return c =>
        //    {
        //        c.Add<UtaNene.Data.NHibernateMaps.Conventions.ForeignKeyConvention>();
        //        c.Add<UtaNene.Data.NHibernateMaps.Conventions.HasManyConvention>();
        //        c.Add<UtaNene.Data.NHibernateMaps.Conventions.HasManyToManyConvention>();
        //        c.Add<UtaNene.Data.NHibernateMaps.Conventions.ManyToManyTableNameConvention>();
        //        c.Add<UtaNene.Data.NHibernateMaps.Conventions.PrimaryKeyConvention>();
        //        c.Add<UtaNene.Data.NHibernateMaps.Conventions.ReferenceConvention>();
        //        c.Add<UtaNene.Data.NHibernateMaps.Conventions.TableNameConvention>();
        //    };
        //}
    }
}
